package com.jastt.dal.entities;

// Generated 08.11.2014 14:19:16 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
 * IssueEntity generated by hbm2java
 */
@Entity
@Table(name = "ISSUE")
public class IssueEntity extends GenericDalEntity<Integer> implements java.io.Serializable {

	private String version;
	private AssigneeEntity assigneeEntity;
	private ProjectEntity projectEntity;
	private String key;
	private String issueType;
	private String status;
	private Date created;
	private Date updated;
	private Date due;
	private Date resolved;
	private String priority;
	private String component;
	private String summary;
	private int timeSpent;
	private Set<WorklogEntity> worklogEntities = new HashSet<WorklogEntity>(0);

	public IssueEntity() {
	}

	public IssueEntity(AssigneeEntity assigneeEntity,
			ProjectEntity projectEntity, String key, String issueType,
			String status, Date created, Date updated, Date due,
			Date resolved, String component, String summary, int timeSpent) {
		this.assigneeEntity = assigneeEntity;
		this.projectEntity = projectEntity;
		this.key = key;
		this.issueType = issueType;
		this.status = status;
		this.created = created;
		this.updated = updated;
		this.due = due;
		this.resolved = resolved;
		this.summary = summary;
		this.timeSpent = timeSpent;
	}

	public IssueEntity(AssigneeEntity assigneeEntity,
			ProjectEntity projectEntity, String key, String issueType,
			String status, Date created, Date updated, Date due,
			Date resolved, String priority, String component, String summary, int timeSpent, Set<WorklogEntity> worklogEntities) {
		this.assigneeEntity = assigneeEntity;
		this.projectEntity = projectEntity;
		this.key = key;
		this.issueType = issueType;
		this.status = status;
		this.created = created;
		this.updated = updated;
		this.due = due;
		this.resolved = resolved;
		this.priority = priority;
		this.component = component;
		this.summary = summary;
		this.timeSpent = timeSpent;
		this.worklogEntities = worklogEntities;
	}

	@Column(name = "VERSION", length = 20)
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ASSIGNEE_ID", nullable = false)
	public AssigneeEntity getAssigneeEntity() {
		return this.assigneeEntity;
	}

	public void setAssigneeEntity(AssigneeEntity assigneeEntity) {
		this.assigneeEntity = assigneeEntity;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false)
	public ProjectEntity getProjectEntity() {
		return this.projectEntity;
	}

	public void setProjectEntity(ProjectEntity projectEntity) {
		this.projectEntity = projectEntity;
	}

	@Column(name = "KEY", nullable = false, length = 100)
	public String getKey() {
		return this.key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	@Column(name = "ISSUE_TYPE", nullable = false, length = 20)
	public String getIssueType() {
		return this.issueType;
	}

	public void setIssueType(String issueType) {
		this.issueType = issueType;
	}

	@Column(name = "STATUS", nullable = false, length = 20)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATED", nullable = false, length = 10)
	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UPDATED", nullable = false, length = 10)
	public Date getUpdated() {
		return this.updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DUE", nullable = true, length = 10)
	public Date getDue() {
		return due;
	}

	public void setDue(Date due) {
		this.due = due;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "RESOLVED", nullable = true, length = 10)
	public Date getResolved() {
		return resolved;
	}

	public void setResolved(Date resolved) {
		this.resolved = resolved;
	}

	@Column(name = "PRIORITY", length = 50)
	public String getPriority() {
		return this.priority;
	}

	public void setPriority(String priority) {
		this.priority = priority;
	}
	
	@Column(name = "COMPONENT", length = 50)
	public String getComponent() {
	    return component;
	}
	
	public void setComponent(String component) {
	    this.component = component;
	}

	@Column(name = "SUMMARY",  length = 1024)
	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(name = "TIME_SPENT", nullable = false)
	public int getTimeSpent() {
		return this.timeSpent;
	}

	public void setTimeSpent(int timeSpent) {
		this.timeSpent = timeSpent;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "issueEntity")
	public Set<WorklogEntity> getWorklogEntities() {
		return this.worklogEntities;
	}

	public void setWorklogEntities(Set<WorklogEntity> worklogEntities) {
		this.worklogEntities = worklogEntities;
	}


}
